<!DOCTYPE html>
<html class="x-admin-sm">

<head>
    <meta charset="UTF-8">
    <title>条件筛选</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width">
    <link rel="stylesheet" href="./css/font.css">
    <link rel="stylesheet" href="./css/xadmin.css">
    <link href="//unpkg.com/layui@2.9.14/dist/css/layui.css" rel="stylesheet">
    <script src="./lib/layui/layui.js" charset="utf-8"></script>
    <script type="text/javascript" src="./js/xadmin.js"></script>
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="./js/jquery.js"></script>
    <script src="./js/common/ajaxUse.js"></script>
    <script src="js/common/FilterExampleQuery.js"></script>
</head>

<body>
<div class="x-nav">
            <span class="layui-breadcrumb">
                <a href="">首页</a>
                <a href="">人员管理</a>
                <a><cite>用户列表</cite></a>
            </span>
    <a class="layui-btn layui-btn-small" style="line-height:1.6em;margin-top:3px;float:right" onclick="location.reload()" title="刷新">
        <i class="layui-icon layui-icon-refresh" style="line-height:30px"></i>
    </a>
</div>
<div class="layui-fluid">
    <div class="layui-row layui-col-space15">
        <div class="layui-col-md12">
            <div class="layui-card" >
                <div class="layui-card-body FilterParent">
                    <div class="layui-inline layui-show-xs-block">
                        <button class="layui-btn"  lay-submit="" lay-filter="search"><i class="layui-icon" onclick="submit('/search/exampleQuery',NotExampleQuery(1))">重置列表</i></button>
                        <button class="layui-btn"  lay-submit="" lay-filter="search"><i class="layui-icon" onclick="addFilter()">新增筛选</i></button>
                        <button class="layui-btn"  lay-submit="" lay-filter="sreach"><i class="layui-icon" onclick="submit('/search/exampleQuery',getExamples(1))">&#xe615;</i></button>
                    </div>
                    <div class="layui-collapse Filter" lay-filter="test">
                        <div class="layui-colla-item">
                            <h2 class="layui-colla-title">条件筛选
                                <a title="删除" onclick="deleteFilter(this.parentElement.parentElement.parentElement)" href="javascript:;">
                                    <i class="layui-icon">&#xe640;</i></a></h2>
                            <div class="layui-colla-content">
                                <form class="layui-form" action="">
                                    <div class="layui-form-item" id="uGender" style="display: inline-block; margin-right: 10px;">
                                        <label for="uGender" class="layui-form-label">
                                            性别
                                        </label>
                                        <div class="layui-input-inline">
                                            <input type="radio" name="uGender" value="男" title="男">
                                            <input type="radio" name="uGender" value="女" title="女">
                                        </div>
                                    </div>
                                    <div class="layui-form-item" style="display: inline-block; margin-right: 10px;">
                                        <label for="uUserName" class="layui-form-label">
                                            用户名
                                        </label>
                                        <div class="layui-input-inline">
                                            <input type="text" id="uUserName" name="uUserName" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item" id="tel" style="display: inline-block; margin-right: 10px;">
                                        <label for="uPhone" class="layui-form-label">
                                            电话
                                        </label>
                                        <div class="layui-input-inline">
                                            <input type="tel" id="uPhone" name="uPhone" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item" style="display: inline-block; margin-right: 10px;">
                                        <label for="uIdCard" class="layui-form-label">
                                            身份证号
                                        </label>
                                        <div class="layui-input-inline">
                                            <input type="text" id="uIdCard" name="uIdCard" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item" style="display: inline-block; margin-right: 10px;">
                                        <label for="uEmail" class="layui-form-label">
                                            邮箱
                                        </label>
                                        <div class="layui-input-inline">
                                            <input type="email" id="uEmail" name="uEmail" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item" style="display: inline-block; margin-right: 10px;">
                                        <label for="uAddress" class="layui-form-label">
                                            详细住址
                                        </label>
                                        <div class="layui-input-inline">
                                            <input type="text" id="uAddress" name="uAddress" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item" style="display: inline-block; margin-right: 10px;">
                                        <label for="uLiveTime" class="layui-form-label">
                                            入住时间
                                        </label>
                                        <div class="layui-input-inline">
                                            <input type="date" id="uLiveTime" name="uLiveTime" autocomplete="off" class="layui-input">
                                        </div>
                                    </div>
                                    <div class="layui-form-item" id="uStatus" style="display: inline-block; margin-right: 10px;">
                                        <label for="uStatus" class="layui-form-label">
                                            性别
                                        </label>
                                        <div class="layui-input-inline">
                                            <input type="radio" name="uStatus" value=1 title="在住">
                                            <input type="radio" name="uStatus" value=0 title="离开">
                                        </div>
                                    </div>

                                    <div class="layui-form-item">
                                        <div class="layui-input-block">
                                            <button type="reset" class="layui-btn layui-btn-primary">重置</button>
                                        </div>
                                    </div>
                                </form>

                            </div>
                        </div>
                    </div>

                </div>
                <div id="FilterDisplayContainer"></div>
                <div class="layui-card-header">
                    <button class="layui-btn" onclick="xadmin.open('添加用户','user-add.html',800,600)">
                        <i class="layui-icon"></i>
                        添加</button></div>
                <div class="layui-card-table ">
                    <table class="layui-table layui-form data-list">
                        <thead>
                        <tr>
                            <th>
                                <input type="checkbox" lay-filter="checkall" name="" lay-skin="primary"></th>
                            <th>用户编号</th>
                            <th>真实姓名</th>
                            <th>用户名</th>
                            <th>密码</th>
                            <th>性别</th>
                            <th>出生日期</th>
                            <th>电话</th>
                            <th>邮箱</th>
                            <th>身份证号</th>
                            <th>详细地址(几单元几号)</th>
                            <th>状态</th>
                            <th>入住时间</th>
                            <th>备注</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
</body>
<!--    ***************************-->
<script>
    submit('/search/exampleQuery',NotExampleQuery(1))

    function doAction (data) {
        layer.open({
            type: 2,
            title: '修改数据', //ifrem的标题
            maxmin: true, //最小化
            shadeClose: true, //点击遮罩关闭层
            area: ['80%', '80%'], //大小
            content: 'user-edit.html',//打开的url
            success: function (layero, index) {
                var body=layer.getChildFrame('body',index);
                body.contents().find('#uId').val(data.childNodes.item(3).innerHTML);
                body.contents().find('#uName').val(data.childNodes.item(5).innerHTML);
                body.contents().find('#uUserName').val(data.childNodes.item(7).innerHTML);
                body.contents().find('#uPassword').val(data.childNodes.item(9).innerHTML);
                var select;
                if(data.childNodes.item(11).innerHTML === '男'){
                    select = 'dd[lay-value=\'1\']'
                }else {
                    select = 'dd[lay-value=\'2\']'
                }
                body.contents().find('#uGender').siblings("div.layui-form-select").find('dl').find(select).click();
                // body.contents().find('#uGender').val(data.childNodes.item(11).innerHTML);
                body.contents().find('#uBirthdate').val(data.childNodes.item(13).innerHTML);
                body.contents().find('#uPhone').val(data.childNodes.item(15).innerHTML);
                body.contents().find('#uEmail').val(data.childNodes.item(17).innerHTML);
                body.contents().find('#uIdCard').val(data.childNodes.item(19).innerHTML);
                body.contents().find('#uAddress').val(data.childNodes.item(21).innerHTML);
                if(data.childNodes.item(23).innerHTML === '离开'){
                    select = 'dd[lay-value=\'0\']'
                }else {
                    select = 'dd[lay-value=\'1\']'
                }
                body.contents().find('#uStatus').siblings("div.layui-form-select").find('dl').find(select).click();
                // body.contents().find('#uStatus').val(data.childNodes.item(23).innerHTML);
                body.contents().find('#uLiveTime').val(data.childNodes.item(25).innerHTML);
                body.contents().find('#uNotes').val(data.childNodes.item(27).innerHTML);
            }
        })
    }
    layui.use(['laydate', 'form'],
        function() {
            var laydate = layui.laydate;
            //执行一个laydate实例
            laydate.render({
                elem: '#start' //指定元素
            });
            //执行一个laydate实例
            laydate.render({
                elem: '#end' //指定元素
            });
        });

    function member_del(obj, id) {
        id = obj.parentElement.parentElement.childNodes.item(3).textContent;
        layer.confirm('确认要删除吗？',function(index){
            submit("/PeopleManager/deregister",JSON.stringify({type:0,deregisterId:id}))
            //发异步删除数据
            $(obj).parents("tr").remove();
        });
    }
</script>
</html>